/*
*			Port³éÏóÀà,¶¥²ã°ü
*/

#pragma once


#include <boost/noncopyable.hpp>
#include <boost/function.hpp>
#include "CxType.h"

using	boost::noncopyable;

//Ê¹ÓÃ±ê×¼¿âstring
using std::string;



//»ù±¾³éÏó¶Ë¿ÚÀà
struct	 CxPort : public	noncopyable
{
	virtual		~CxPort(){}
	
	//¹Ø±Õ¶Ë¿Ú
	virtual		bool	ClosePort()=0;

	//»ñÈ¡¶Ë¿Ú×´Ì¬
	virtual		bool	IsOpen()const=0;
	virtual		UINT	GetPortState()const=0;

	//»ù±¾¶Ë¿Ú¶Á²Ù×÷
	virtual		size_t	ReadPort(BYTE	*,size_t )=0;
	//»ù±¾¶Ë¿ÚÐ´²Ù×÷
	virtual		size_t	WritePort(const BYTE *,size_t )=0;

	//»ù±¾¶Ë¿ÚÒì²½¶Á²Ù×÷ ÐèÒª´«Èë»Øµ÷º¯Êý²Ù×÷³É¹¦ºó»Øµ÷
	virtual		void	Async_ReadPort(BYTE *,size_t ,Async_Handler &)=0;
	//»ù±¾¶Ë¿ÚÒì²½Ð´²Ù×÷ ÐèÒª´«Èë»Øµ÷º¯Êý²Ù×÷³É¹¦ºó»Øµ÷
	virtual		void	Async_WritePort(const BYTE*,size_t ,Async_Handler &)=0;
};
